<!--
 * @Description: 学员档案form页
 * @Autor: dyx
 * @Date: 2023-03-03 11:27:23
 * @LastEditTime: 2023-05-31 15:48:35
-->
<template>
  <transition name="el-zoom-in-center">
    <div class="JADP-preview-main">
      <div class="JADP-common-page-header">
        <el-page-header @back="goBack" content="学员档案" />
        <div class="options">
          <el-button @click="goBack">取 消</el-button>
        </div>
      </div>
      <el-tabs v-model="activeName" tab-position="left" style="height: 100%;">
        <el-tab-pane label="基本信息" name="basicInformation">
          <BasicInformation />
        </el-tab-pane>
        <el-tab-pane label="新上岗考核记录表" name="NewEmpExamRecordVue" v-if="!this.isEvidenceCollection">
          <NewEmpExamRecordVue ref="NewEmpExamRecordVue" v-if="!this.isEvidenceCollection"/>
        </el-tab-pane>
        <el-tab-pane label="培训班" name="trainingClass">
          <TrainingClass ref="TrainingClass" @update-value="updateValue" />
        </el-tab-pane>
        <el-tab-pane label="培训课程" name="trainingCourse">
          <TrainingCourse />
        </el-tab-pane>
        <el-tab-pane label="培训成绩" name="trainingPerformance">
          <TrainingPerformance />
        </el-tab-pane>
        <el-tab-pane label="培训证书" name="trainingCertificate">
          <TrainingCertificate />
        </el-tab-pane>
        <el-tab-pane label="学员登记表" name="studentRegistrationForm" v-if="this.isEvidenceCollection">
          <TSRScheduleVue ref="TSRScheduleVue" v-if="this.isEvidenceCollection"/>
        </el-tab-pane>
      </el-tabs>
    </div>
  </transition>
</template>
<script>
import BasicInformation from "./basicInformation";
import TrainingClass from "./trainingClass";
import TrainingCourse from "./trainingCourse";
import TrainingPerformance from "./trainingPerformance";
import TrainingCertificate from "./trainingCertificate";
import TSRScheduleVue from "./components/TSRSchedule.vue";
import NewEmpExamRecordVue from "./components/NewEmpExamRecord.vue";
export default {
  components: {
    BasicInformation,
    TrainingClass,
    TrainingCourse,
    TrainingPerformance,
    TrainingCertificate,
    TSRScheduleVue,
    NewEmpExamRecordVue
  },

  provide() {
    return {
      stuid: this.studentProfile
    };
  },

  data() {
    return {
      visible: false,
      activeName: "basicInformation",
      studentProfile: {
        id: ""
      },
      isEvidenceCollection: false
    };
  },
  methods: {
    goBack() {
      this.$emit("refresh");
    },
    updateValue(value) {
      console.log(value, "value");
      this.isEvidenceCollection = value;
    },
    init(id, isAdmin, studentid) {
      this.studentProfile.id = id;
      console.log(studentid, "studentid");
      this.visible = true;
      this.$refs.TSRScheduleVue && this.$refs.TSRScheduleVue.init(studentid);
      this.$refs.NewEmpExamRecordVue && this.$refs.NewEmpExamRecordVue.init(studentid);
    }
  }
}
</script>

<style lang="scss" scoped>
>>>.el-tabs__content {
  overflow: hidden;
  position: relative;
  height: 100%;

  &>.el-tab-pane {
    height: 100%;
  }
}
</style>
